class PaginationListLinkRenderer < WillPaginate::ViewHelpers::LinkRenderer
  
  protected

    def page_number(page)
      unless page == current_page
        tag(:span, link(page, page, :rel => rel_value(page)), :class => "paginate_button")
      else
        tag(:span, page, :class => "paginate_active")
      end
    end

    def previous_or_next_page(page, text, classname)      
      if classname == "next_page"
        if page
          link("<span class='next paginate_button'>"+"paginate</span>", page) + link("<span class='last paginate_button'>"+"paginate</span>", total_pages)
        else
          "<span class='"+@name+" paginate_button'>"+"paginate</span>" + "<span class='last paginate_button'>"+"paginate</span>"
        end
      else
        if page
          link("<span class='first paginate_button'>"+"paginate</span>", "1") + link("<span class='previous paginate_button'>"+"paginate</span>", page)
        else
          "<span class='first paginate_button'>"+"paginate</span>" + "<span class='previous paginate_button'>"+"paginate</span>"
        end      
      end     
      
    end

    def html_container(html)
      tag(:div, html, container_attributes)
    end

end